package com.zzzyh.forumsystemclient.dao;

import com.zzzyh.forumsystemclient.model.ChatRoom;
import com.zzzyh.forumsystemclient.model.UserFriendChatroom;
import org.apache.ibatis.annotations.Param;

import java.util.List;

public interface ChatRoomMapper {
    int insert(ChatRoom row);

    int insertSelective(ChatRoom row);

    ChatRoom selectByPrimaryKey(Long id);

    int updateByPrimaryKeySelective(ChatRoom row);

    int updateByPrimaryKey(ChatRoom row);

    void insertFriendChatroom(UserFriendChatroom userFriendChatroom);

    List<Integer> getFriendChatroomsByUserId(Integer userID);

    void updateUnreadCount(@Param("roomId") Long roomId, @Param("userId") Integer userId, @Param("unreadCount") Integer unreadCount);

    Integer existUnreadMsg(@Param("roomId") Long roomId, @Param("userId") Integer userId);

    void insertUnreadMsg(@Param("roomId") Long roomId, @Param("userId") Integer userId, @Param("unreadCount") Integer unreadCount);

    String getNameById(Integer userId);
}